<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html">
	<f:view contentType="text/html" />
	<h:head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<link href="/cultbookweb/includes/css/theme.css" media="screen" rel="stylesheet" type="text/css" />
		<link href="/cultbookweb/includes/css/theme_override.css" media="screen" rel="stylesheet" type="text/css" />
		<link href="/cultbookweb/includes/css/style.css" media="screen" rel="stylesheet" type="text/css" />
		<title>Cultbook</title>
	</h:head>
	<h:body>
		<div id="container">
			<div id="header">
				<h1>
					<a href="/cultbookweb">Trabalho da Pós</a>
				</h1>
				<div id="user-navigation">
					<ul class="wat-cf">
						<li>
							<span style="color: #0066CC;">Olá #{clienteLoginBean.nome}!!</span>
						</li>
						<li>
							<h:form>
								<h:commandLink value="Meu Carrinho" action="#{carrinhoBean.carrinho()}" class="logout" rendered="#{clienteLoginBean.nome != 'Convidado'}" />
							</h:form>
						</li>
						<li>
							<h:form>
								<h:commandButton rendered="#{clienteLoginBean.nome != 'Convidado'}" action="#{clienteLoginBean.deslogar()}" value="Logout" />
							</h:form>
						</li>
					</ul>
				</div>
				<div id="main-navigation">
					<ul class="wat-cf">
						<li><a href="#">&nbsp;</a></li>
					</ul>
				</div>
			</div>
			<div id="wrapper" class="wat-cf">
				<div class="flash"></div>
				<div id="main">
					<div class="block">
						<div class="content">
							<h2 class="title">Top 10 vendidos</h2> 
							<h3>
							<h:form>
								<h:commandButton action="#{listaLivrosBean.listarTodosLivros}" value="Todos os livros" />
							</h:form>
							</h3>
							<div class="inner">
								<h:form id="maisVendidosForm" class="table">
									<h:dataTable width="100%" value="#{maisVendidosBean.livrosLista}" var="livro" border="1" cellspacing="0">
										<h:column>
											<f:facet name="header">ISBN</f:facet> #{livro.isbn}
										</h:column>
										<h:column>
											<f:facet name="header">Título</f:facet> #{livro.titulo}
										</h:column>
										<h:column>
											<f:facet name="header">Autor</f:facet> #{livro.autor}
										</h:column>
										<h:column>
											<f:facet name="header">Preço</f:facet> #{livro.preco}
										</h:column>
										<h:column id="column5">
											<f:facet name="header">Opções</f:facet>
											<h:commandLink action="#{listaLivrosBean.visualizarLivro(livro)}" value="Detalhes" />
										</h:column>
									</h:dataTable>
								</h:form>
								<div class="actions-bar wat-cf">
									<div class="actions"></div>
								</div>
							</div>
						</div>
					</div>
					<div id="footer">
						<div class="block">
							<h:form id="buscaForm" method="post">
								Buscar Livros na Loja:
								<h:selectOneMenu id="tipoBusca" value="#{listaLivrosBean.tipoBusca}">
								  <f:selectItem id="item1" itemLabel="ISBN" itemValue="isbn" />
								  <f:selectItem id="item2" itemLabel="Título" itemValue="titulo" />
								  <f:selectItem id="item3" itemLabel="Autor" itemValue="autor" />
								</h:selectOneMenu>
								<h:inputText value="#{listaLivrosBean.buscaPorNome}" size="50" />
								<h:commandButton action="#{listaLivrosBean.listarLivros}" value="Buscar" />
								<p>&nbsp;</p>
							</h:form>
						</div>
					</div>
				</div>
			</div>
		</div>
	</h:body>
</html>
